package com.xing.controller;

import com.xing.Utils.Result;
import com.xing.dto.AuthenticationDTO;
import com.xing.entity.AuthenticationEntity;
import com.xing.service.AuthenticationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @version 1.0
 * @Author Xing
 * @Date 2024/4/19 21:16
 */
@Tag(name = "认证管理")
@RestController
@RequestMapping("/authentication")
public class AuthenticationController {
    @Autowired
    private AuthenticationService service;
    @Operation(summary = "主播身份认证申请")
    @PostMapping("/info")
    public Result getInfo(@RequestBody AuthenticationDTO auth) {
        boolean isAuthenticated = service.isAuthenticated(auth);
        if (isAuthenticated){
            return new Result().ok();
        }
        return new Result().err(601,"认证信息错误");
    }

}
